-module(enTest).
-include("eVPack.hrl").

-compile([no_auto_import]).

-export([
   test/0
]).

test() ->
   try do() of
      _ ->
         'all test is pass'
   catch
      E:C:S ->
         {E, C, S}
   end.

do() ->
   <<25>> = eVPack:encodeBin(false),
   <<26>> = eVPack:encodeBin(true),
   <<27, 102, 102, 102, 102, 102, 182, 96, 64>> = eVPack:encodeBin(1.33699999999999988631e+2),
   <<27, 102, 102, 102, 102, 102, 182, 96, 192>> = eVPack:encodeBin(-1.33699999999999988631e+2),
   <<30>> = eVPack:encodeBin(minKey),
   <<31>> = eVPack:encodeBin(maxKey),
   <<48>> = eVPack:encodeBin(0),
   <<49>> = eVPack:encodeBin(1),
   <<50>> = eVPack:encodeBin(2),
   <<51>> = eVPack:encodeBin(3),
   <<52>> = eVPack:encodeBin(4),
   <<53>> = eVPack:encodeBin(5),
   <<54>> = eVPack:encodeBin(6),
   <<55>> = eVPack:encodeBin(7),
   <<56>> = eVPack:encodeBin(8),
   <<57>> = eVPack:encodeBin(9),
   <<58>> = eVPack:encodeBin(-6),
   <<59>> = eVPack:encodeBin(-5),
   <<60>> = eVPack:encodeBin(-4),
   <<61>> = eVPack:encodeBin(-3),
   <<62>> = eVPack:encodeBin(-2),
   <<63>> = eVPack:encodeBin(-1),
   <<32, (-7)/integer-little-signed>> = eVPack:encodeBin(-7),
   <<32, 128>> = eVPack:encodeBin(-128),
   <<33, 0, 128>> = eVPack:encodeBin(-32768),
   <<34, 0, 0, 128>> = eVPack:encodeBin(-8388608),
   <<35, 0, 0, 0, 128>> = eVPack:encodeBin(-2147483648),
   <<36, 0, 0, 0, 0, 128>> = eVPack:encodeBin(-549755813888),
   <<37, 0, 0, 0, 0, 0, 128>> = eVPack:encodeBin(-140737488355328),
   <<38, 0, 0, 0, 0, 0, 0, 128>> = eVPack:encodeBin(-36028797018963968),
   <<39, 0, 0, 0, 0, 0, 0, 0, 128>> = eVPack:encodeBin(-9223372036854775808),
   <<40, 255>> = eVPack:encodeBin(255),
   <<41, 255, 255>> = eVPack:encodeBin(65535),
   <<42, 255, 255, 255>> = eVPack:encodeBin(16777215),
   <<43, 255, 255, 255, 255>> = eVPack:encodeBin(4294967295),
   <<44, 255, 255, 255, 255, 255>> = eVPack:encodeBin(1099511627775),
   <<45, 255, 255, 255, 255, 255, 255>> = eVPack:encodeBin(281474976710655),
   <<46, 255, 255, 255, 255, 255, 255, 255>> = eVPack:encodeBin(72057594037927935),
   <<47, 255, 255, 255, 255, 255, 255, 255, 255>> = eVPack:encodeBin(18446744073709551615),
   <<75, 72, 97, 108, 108, 111, 32, 87, 101, 108, 116, 33>> = eVPack:encodeBin(<<"Hallo Welt!">>),
   <<76, 72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33>> = eVPack:encodeBin(<<"Hello World!">>),
   _Str = <<"Lorem ipsum dolor sit amet, consectetuer "
   "adipiscing elit. Aenean commodo ligula "
   "eget dolor. ",
      "Aenean massa. Cum sociis natoque penatibus "
      "et magnis dis parturient montes, nascetur "
      "ridiculus mus. ",
      "Donec quam felis, ultricies nec, pellentesque "
      "eu, pretium quis, sem. Nulla consequat "
      "massa quis enim. ",
      "Donec pede justo, fringilla vel, aliquet "
      "nec, vulputate eget, arcu. In enim justo, "
      "rhoncus ut, imperdiet a, ",
      "venenatis vitae, justo. Nullam dictum "
      "felis eu pede mollis pretium. Integer "
      "tincidunt. Cras dapibus. ",
      "Vivamus elementum semper nisi. Aenean "
      "vulputate eleifend tellus.">>,
   _StrBin = <<191, 55, 2, 0, 0, 0, 0, 0, 0, 76, 111, 114, 101, 109, 32, 105, 112, 115, 117, 109, 32, 100, 111, 108, 111,
      114, 32, 115, 105, 116, 32, 97, 109, 101, 116, 44, 32, 99, 111, 110, 115, 101, 99, 116, 101, 116, 117, 101,
      114, 32, 97, 100, 105, 112, 105, 115, 99, 105, 110, 103, 32, 101, 108, 105, 116, 46, 32, 65, 101, 110, 101,
      97, 110, 32, 99, 111, 109, 109, 111, 100, 111, 32, 108, 105, 103, 117, 108, 97, 32, 101, 103, 101,
      116, 32, 100, 111, 108, 111, 114, 46, 32, 65, 101, 110, 101, 97, 110, 32, 109, 97, 115, 115,
      97, 46, 32, 67, 117, 109, 32, 115, 111, 99, 105, 105, 115, 32, 110, 97, 116, 111, 113, 117,
      101, 32, 112, 101, 110, 97, 116, 105, 98, 117, 115, 32, 101, 116, 32, 109, 97, 103, 110, 105,
      115, 32, 100, 105, 115, 32, 112, 97, 114, 116, 117, 114, 105, 101, 110, 116, 32, 109, 111, 110,
      116, 101, 115, 44, 32, 110, 97, 115, 99, 101, 116, 117, 114, 32, 114, 105, 100, 105, 99, 117,
      108, 117, 115, 32, 109, 117, 115, 46, 32, 68, 111, 110, 101, 99, 32, 113, 117, 97, 109, 32,
      102, 101, 108, 105, 115, 44, 32, 117, 108, 116, 114, 105, 99, 105, 101, 115, 32, 110, 101, 99,
      44, 32, 112, 101, 108, 108, 101, 110, 116, 101, 115, 113, 117, 101, 32, 101, 117, 44, 32, 112,
      114, 101, 116, 105, 117, 109, 32, 113, 117, 105, 115, 44, 32, 115, 101, 109, 46, 32, 78, 117,
      108, 108, 97, 32, 99, 111, 110, 115, 101, 113, 117, 97, 116, 32, 109, 97, 115, 115, 97, 32,
      113, 117, 105, 115, 32, 101, 110, 105, 109, 46, 32, 68, 111, 110, 101, 99, 32, 112, 101, 100,
      101, 32, 106, 117, 115, 116, 111, 44, 32, 102, 114, 105, 110, 103, 105, 108, 108, 97, 32, 118,
      101, 108, 44, 32, 97, 108, 105, 113, 117, 101, 116, 32, 110, 101, 99, 44, 32, 118, 117, 108,
      112, 117, 116, 97, 116, 101, 32, 101, 103, 101, 116, 44, 32, 97, 114, 99, 117, 46, 32, 73,
      110, 32, 101, 110, 105, 109, 32, 106, 117, 115, 116, 111, 44, 32, 114, 104, 111, 110, 99, 117,
      115, 32, 117, 116, 44, 32, 105, 109, 112, 101, 114, 100, 105, 101, 116, 32, 97, 44, 32, 118,
      101, 110, 101, 110, 97, 116, 105, 115, 32, 118, 105, 116, 97, 101, 44, 32, 106, 117, 115, 116,
      111, 46, 32, 78, 117, 108, 108, 97, 109, 32, 100, 105, 99, 116, 117, 109, 32, 102, 101, 108,
      105, 115, 32, 101, 117, 32, 112, 101, 100, 101, 32, 109, 111, 108, 108, 105, 115, 32, 112, 114,
      101, 116, 105, 117, 109, 46, 32, 73, 110, 116, 101, 103, 101, 114, 32, 116, 105, 110, 99, 105,
      100, 117, 110, 116, 46, 32, 67, 114, 97, 115, 32, 100, 97, 112, 105, 98, 117, 115, 46, 32,
      86, 105, 118, 97, 109, 117, 115, 32, 101, 108, 101, 109, 101, 110, 116, 117, 109, 32, 115, 101,
      109, 112, 101, 114, 32, 110, 105, 115, 105, 46, 32, 65, 101, 110, 101, 97, 110, 32, 118, 117,
      108, 112, 117, 116, 97, 116, 101, 32, 101, 108, 101, 105, 102, 101, 110, 100, 32, 116, 101, 108,
      108, 117, 115, 46>>,
   %%StrBin = eVPack:encodeBin(Str),

   <<1>> = eVPack:encodeBin([]),

   <<19, 6, 49, 40, 16, 2>> = eVPack:encodeBin([1, 16], ?VpArrYc, ?VpObjDef),
   Arr = <<"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. ", "Aenean massa. Cum sociis ...">>,
   ArrList = [Arr, 1, 2, 42],
   <<19, _/binary>> = eVPack:encodeBin(ArrList, ?VpArrYc, ?VpObjDef),
  %%  ArrList = eVPack:decode(ArrBin),
   ArrLists = <<2, 12, 2, 5, 49, 50, 51, 2, 5, 49, 50, 51>>,
   ArrsBin = [[1, 2, 3], [1, 2, 3]],
   ArrLists = eVPack:encodeBin(ArrsBin),
   <<10>> = eVPack:encodeBin(#{}),
   <<11, 8, 1, 65, 97, 65, 98, 3>> = eVPack:encodeBin(#{<<"a">> => <<"b">>}),
   <<11, 13, 2, 65, 97, 65, 98, 65, 98, 65, 97, 3, 7>> = eVPack:encodeBin(#{a => <<"b">>, b => <<"a">>}),
   Maps = #{<<"0">> =>
   #{<<"0">> => <<"test">>, <<"1">> => <<"test">>,
      <<"2">> => <<"test">>, <<"3">> => <<"test">>,
      <<"4">> => <<"test">>},
      <<"1">> =>
      #{<<"0">> => <<"test">>, <<"1">> => <<"test">>,
         <<"2">> => <<"test">>, <<"3">> => <<"test">>,
         <<"4">> => <<"test">>},
      <<"2">> =>
      #{<<"0">> => <<"test">>, <<"1">> => <<"test">>,
         <<"2">> => <<"test">>, <<"3">> => <<"test">>,
         <<"4">> => <<"test">>},
      <<"3">> =>
      #{<<"0">> => <<"test">>, <<"1">> => <<"test">>,
         <<"2">> => <<"test">>, <<"3">> => <<"test">>,
         <<"4">> => <<"test">>},
      <<"4">> =>
      #{<<"0">> => <<"test">>, <<"1">> => <<"test">>,
         <<"2">> => <<"test">>, <<"3">> => <<"test">>,
         <<"4">> => <<"test">>}},
   MapBin = <<11, 233, 5, 65, 48, 11, 43, 5, 65, 48, 68, 116, 101, 115, 116, 65, 49, 68, 116, 101, 115, 116, 65, 50, 68, 116, 101,
      115, 116, 65, 51, 68, 116, 101, 115, 116, 65, 52, 68, 116, 101, 115, 116, 3, 10, 17, 24, 31, 65, 49, 11,
      43, 5, 65, 48, 68, 116, 101, 115, 116, 65, 49, 68, 116, 101, 115, 116, 65, 50, 68, 116, 101, 115, 116, 65, 51, 68, 116, 101,
      115, 116, 65, 52, 68, 116, 101, 115, 116, 3, 10, 17, 24, 31, 65, 50, 11, 43, 5, 65, 48, 68, 116, 101, 115, 116, 65, 49,
      68, 116, 101, 115, 116, 65, 50, 68, 116, 101, 115, 116, 65, 51, 68, 116, 101, 115, 116, 65, 52, 68, 116, 101, 115, 116, 3, 10,
      17, 24, 31, 65, 51, 11, 43, 5, 65, 48, 68, 116, 101, 115, 116, 65, 49, 68, 116, 101, 115, 116, 65, 50, 68, 116, 101, 115,
      116, 65, 51, 68, 116, 101, 115, 116, 65, 52, 68, 116, 101, 115, 116, 3, 10, 17, 24, 31, 65, 52, 11, 43,
      5, 65, 48, 68, 116, 101, 115, 116, 65, 49, 68, 116, 101, 115, 116, 65, 50, 68, 116, 101, 115, 116, 65, 51, 68, 116, 101, 115,
      116, 65, 52, 68, 116, 101, 115, 116, 3, 10, 17, 24, 31, 3, 48, 93, 138, 183>>,
   MapBin = eVPack:encodeBin(Maps, ?VpArrDef, ?VpObjNcYs),
   Mapss = #{<<"0">> =>
   #{<<"0">> => <<"test">>, <<"1">> => <<"test">>,
      <<"2">> => <<"test">>, <<"3">> => <<"test">>,
      <<"4">> => <<"test">>, <<"5">> => <<"test">>,
      <<"6">> => <<"test">>, <<"7">> => <<"test">>,
      <<"8">> => <<"test">>, <<"9">> => <<"test">>},
      <<"1">> =>
      #{<<"0">> => <<"test">>, <<"1">> => <<"test">>,
         <<"2">> => <<"test">>, <<"3">> => <<"test">>,
         <<"4">> => <<"test">>, <<"5">> => <<"test">>,
         <<"6">> => <<"test">>, <<"7">> => <<"test">>,
         <<"8">> => <<"test">>, <<"9">> => <<"test">>},
      <<"2">> =>
      #{<<"0">> => <<"test">>, <<"1">> => <<"test">>,
         <<"2">> => <<"test">>, <<"3">> => <<"test">>,
         <<"4">> => <<"test">>, <<"5">> => <<"test">>,
         <<"6">> => <<"test">>, <<"7">> => <<"test">>,
         <<"8">> => <<"test">>, <<"9">> => <<"test">>},
      <<"3">> =>
      #{<<"0">> => <<"test">>, <<"1">> => <<"test">>,
         <<"2">> => <<"test">>, <<"3">> => <<"test">>,
         <<"4">> => <<"test">>, <<"5">> => <<"test">>,
         <<"6">> => <<"test">>, <<"7">> => <<"test">>,
         <<"8">> => <<"test">>, <<"9">> => <<"test">>},
      <<"4">> =>
      #{<<"0">> => <<"test">>, <<"1">> => <<"test">>,
         <<"2">> => <<"test">>, <<"3">> => <<"test">>,
         <<"4">> => <<"test">>, <<"5">> => <<"test">>,
         <<"6">> => <<"test">>, <<"7">> => <<"test">>,
         <<"8">> => <<"test">>, <<"9">> => <<"test">>},
      <<"5">> =>
      #{<<"0">> => <<"test">>, <<"1">> => <<"test">>,
         <<"2">> => <<"test">>, <<"3">> => <<"test">>,
         <<"4">> => <<"test">>, <<"5">> => <<"test">>,
         <<"6">> => <<"test">>, <<"7">> => <<"test">>,
         <<"8">> => <<"test">>, <<"9">> => <<"test">>},
      <<"6">> =>
      #{<<"0">> => <<"test">>, <<"1">> => <<"test">>,
         <<"2">> => <<"test">>, <<"3">> => <<"test">>,
         <<"4">> => <<"test">>, <<"5">> => <<"test">>,
         <<"6">> => <<"test">>, <<"7">> => <<"test">>,
         <<"8">> => <<"test">>, <<"9">> => <<"test">>},
      <<"7">> =>
      #{<<"0">> => <<"test">>, <<"1">> => <<"test">>,
         <<"2">> => <<"test">>, <<"3">> => <<"test">>,
         <<"4">> => <<"test">>, <<"5">> => <<"test">>,
         <<"6">> => <<"test">>, <<"7">> => <<"test">>,
         <<"8">> => <<"test">>, <<"9">> => <<"test">>},
      <<"8">> =>
      #{<<"0">> => <<"test">>, <<"1">> => <<"test">>,
         <<"2">> => <<"test">>, <<"3">> => <<"test">>,
         <<"4">> => <<"test">>, <<"5">> => <<"test">>,
         <<"6">> => <<"test">>, <<"7">> => <<"test">>,
         <<"8">> => <<"test">>, <<"9">> => <<"test">>},
      <<"9">> =>
      #{<<"0">> => <<"test">>, <<"1">> => <<"test">>,
         <<"2">> => <<"test">>, <<"3">> => <<"test">>,
         <<"4">> => <<"test">>, <<"5">> => <<"test">>,
         <<"6">> => <<"test">>, <<"7">> => <<"test">>,
         <<"8">> => <<"test">>, <<"9">> => <<"test">>}},
   MapsBin = <<12, 107, 3, 10, 0, 65, 48, 11, 83, 10, 65, 48, 68, 116, 101, 115, 116, 65, 49, 68, 116, 101, 115, 116, 65, 50, 68,
      116, 101, 115, 116, 65, 51, 68, 116, 101, 115, 116, 65, 52, 68, 116, 101, 115, 116, 65, 53, 68, 116, 101, 115, 116, 65, 54, 68, 116, 101, 115, 116,
      65, 55, 68, 116, 101, 115, 116, 65, 56, 68, 116, 101, 115, 116, 65, 57, 68, 116, 101, 115, 116, 3, 10, 17, 24, 31, 38, 45,
      52, 59, 66, 65, 49, 11, 83, 10, 65, 48, 68, 116, 101, 115, 116, 65, 49, 68, 116, 101, 115, 116, 65, 50, 68, 116, 101, 115,
      116, 65, 51, 68, 116, 101, 115, 116, 65, 52, 68, 116, 101, 115, 116, 65, 53, 68, 116, 101, 115, 116, 65, 54,
      68, 116, 101, 115, 116, 65, 55, 68, 116, 101, 115, 116, 65, 56, 68, 116, 101, 115, 116, 65, 57, 68, 116, 101,
      115, 116, 3, 10, 17, 24, 31, 38, 45, 52, 59, 66, 65, 50, 11, 83, 10, 65, 48, 68, 116, 101, 115, 116,
      65, 49, 68, 116, 101, 115, 116, 65, 50, 68, 116, 101, 115, 116, 65, 51, 68, 116, 101, 115, 116, 65, 52, 68,
      116, 101, 115, 116, 65, 53, 68, 116, 101, 115, 116, 65, 54, 68, 116, 101, 115, 116, 65, 55, 68, 116, 101, 115,
      116, 65, 56, 68, 116, 101, 115, 116, 65, 57, 68, 116, 101, 115, 116, 3, 10, 17, 24, 31, 38, 45, 52, 59,
      66, 65, 51, 11, 83, 10, 65, 48, 68, 116, 101, 115, 116, 65, 49, 68, 116, 101, 115, 116, 65, 50, 68, 116, 101, 115, 116, 65,
      51, 68, 116, 101, 115, 116, 65, 52, 68, 116, 101, 115, 116, 65, 53, 68, 116, 101, 115, 116, 65, 54, 68, 116,
      101, 115, 116, 65, 55, 68, 116, 101, 115, 116, 65, 56, 68, 116, 101, 115, 116, 65, 57, 68, 116, 101, 115, 116,
      3, 10, 17, 24, 31, 38, 45, 52, 59, 66, 65, 52, 11, 83, 10, 65, 48, 68, 116, 101, 115, 116, 65, 49,
      68, 116, 101, 115, 116, 65, 50, 68, 116, 101, 115, 116, 65, 51, 68, 116, 101, 115, 116, 65, 52, 68, 116, 101, 115, 116, 65, 53,
      68, 116, 101, 115, 116, 65, 54, 68, 116, 101, 115, 116, 65, 55, 68, 116, 101, 115, 116, 65, 56, 68, 116, 101, 115, 116, 65, 57,
      68, 116, 101, 115, 116, 3, 10, 17, 24, 31, 38, 45, 52, 59, 66, 65, 53, 11, 83, 10, 65, 48, 68, 116, 101, 115, 116, 65,
      49, 68, 116, 101, 115, 116, 65, 50, 68, 116, 101, 115, 116, 65, 51, 68, 116, 101, 115, 116, 65, 52, 68, 116,
      101, 115, 116, 65, 53, 68, 116, 101, 115, 116, 65, 54, 68, 116, 101, 115, 116, 65, 55, 68, 116, 101, 115, 116,
      65, 56, 68, 116, 101, 115, 116, 65, 57, 68, 116, 101, 115, 116, 3, 10, 17, 24, 31, 38, 45, 52, 59, 66,
      65, 54, 11, 83, 10, 65, 48, 68, 116, 101, 115, 116, 65, 49, 68, 116, 101, 115, 116, 65, 50, 68, 116, 101, 115, 116, 65, 51, 68, 116, 101, 115,
      116, 65, 52, 68, 116, 101, 115, 116, 65, 53, 68, 116, 101, 115, 116, 65, 54, 68, 116, 101, 115, 116, 65, 55,
      68, 116, 101, 115, 116, 65, 56, 68, 116, 101, 115, 116, 65, 57, 68, 116, 101, 115, 116, 3, 10, 17, 24, 31,
      38, 45, 52, 59, 66, 65, 55, 11, 83, 10, 65, 48, 68, 116, 101, 115, 116, 65, 49, 68, 116, 101, 115, 116, 65, 50, 68, 116,
      101, 115, 116, 65, 51, 68, 116, 101, 115, 116, 65, 52, 68, 116, 101, 115, 116, 65, 53, 68, 116, 101, 115, 116, 65, 54, 68, 116,
      101, 115, 116, 65, 55, 68, 116, 101, 115, 116, 65, 56, 68, 116, 101, 115, 116, 65, 57, 68, 116, 101, 115, 116, 3, 10, 17, 24,
      31, 38, 45, 52, 59, 66, 65, 56, 11, 83, 10, 65, 48, 68, 116, 101, 115, 116, 65, 49, 68, 116, 101, 115, 116, 65, 50, 68,
      116, 101, 115, 116, 65, 51, 68, 116, 101, 115, 116, 65, 52, 68, 116, 101, 115, 116, 65, 53, 68, 116, 101, 115, 116, 65, 54, 68,
      116, 101, 115, 116, 65, 55, 68, 116, 101, 115, 116, 65, 56, 68, 116, 101, 115, 116, 65, 57, 68, 116, 101, 115, 116, 3, 10, 17,
      24, 31, 38, 45, 52, 59, 66, 65, 57, 11, 83, 10, 65, 48, 68, 116, 101, 115, 116, 65, 49, 68, 116, 101, 115, 116, 65, 50,
      68, 116, 101, 115, 116, 65, 51, 68, 116, 101, 115, 116, 65, 52, 68, 116, 101, 115, 116, 65, 53, 68, 116, 101, 115, 116, 65, 54,
      68, 116, 101, 115, 116, 65, 55, 68, 116, 101, 115, 116, 65, 56, 68, 116, 101, 115, 116, 65, 57, 68, 116, 101,
      115, 116, 3, 10, 17, 24, 31, 38, 45, 52, 59, 66, 5, 0, 90, 0, 175, 0, 4, 1, 89, 1, 174, 1, 3, 2, 88, 2, 173, 2, 2, 3>>,
   MapsBin = eVPack:encodeBin(Mapss, ?VpArrDef, ?VpObjNcYs),

   MapCom = #{<<"a">> => 12, <<"b">> => true, <<"c">> => <<"xyz">>},
   MapComBin = <<20, 16, 65, 97, 40, 12, 65, 98, 26, 65, 99, 67, 120, 121, 122, 3>>,
   MapComBin = eVPack:encodeBin(MapCom, ?VpArrDef, ?VpObjYc).
